package
{
	import flash.display.MovieClip;
	import flash.geom.ColorTransform;

	public class csColor
	{
		private var _mc:MovieClip;
		
		public function csColor(mc:MovieClip):void
		{
			_mc = mc;
		}
		
		public function setRGB(v:uint):void
		{
			_mc.transform.colorTransform.color = v;
		}
		
		public function setTransform(transformObject: Object):void
		{
//			trace("csColor.setTransform");

			var ra:Number = (transformObject.ra != null)? transformObject.ra / 100: 1;
			var rb:Number = (transformObject.rb != null)? transformObject.rb / 255: 0;
			var ga:Number = (transformObject.ga != null)? transformObject.ga / 100: 1;
			var gb:Number = (transformObject.gb != null)? transformObject.gb / 255: 0;
			var ba:Number = (transformObject.ba != null)? transformObject.ba / 100: 1;
			var bb:Number = (transformObject.bb != null)? transformObject.bb / 255: 0;
			var aa:Number = (transformObject.aa != null)? transformObject.aa / 100: 1;
			var ab:Number = (transformObject.ab != null)? transformObject.ab / 255: 0;

			_mc.transform.colorTransform = new ColorTransform(
				ra,
				ga,
				ba,
				aa,
				rb,
				gb,
				bb,
				ab
			);
			
		}

	}
}